package com.guigu.www.luolujin.Conteoller;

import com.guigu.www.luolujin.Service.LljConstitutionTestService;
import com.guigu.www.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作者 罗露金
 */
@RestController
@RequestMapping("/lljconTestServilet")
public class ConTestServilet {

    @Autowired
    LljConstitutionTestService service;
    @GetMapping()
    public PageVo<ConstitutionTest> PageConstitution(Integer pageNum, Integer pageSize, String conTestName){
        return service.PageConstitution(pageNum, pageSize, conTestName);
    }
    @GetMapping("/by")
    public Member queryById(String memName, String memIdentity) {
        return service.queryById(memName, memIdentity);
    }
    @GetMapping("/selectRubric")
    public List<Rubric> selectRubric(Integer rubType) {
        return service.selectRubric(rubType);
    }
    @PostMapping()
    public void insertUserAnswer(@RequestBody List<UserAnswer> UserAnswer, String memId) {
        service.insertUserAnswer(memId,UserAnswer);
    }
    @PostMapping("/add")
    public void insertConstitutionTest(String conTestName, Integer memId) {
        service.insertConstitutionTest(conTestName, memId);
    }
    @GetMapping("/query")
    public List<Rubric> queryRubric(Integer quesType, Integer memId) {
        return service.queryRubric(quesType, memId);
    }
}
